package com.micro.service;

import org.json.JSONException;
import org.json.JSONObject;

import com.micro.data.AccountInfo;

public class JsonToData {

	public static AccountInfo getAccountInfo(String message){
		AccountInfo account = new AccountInfo();
		try {
			JSONObject jsonData = new JSONObject(message);
			account.setUid(jsonData.getString("id"));
			account.setScreenName(jsonData.getString("screen_name"));
			account.setUserName(jsonData.getString("name"));
			account.setDescription(jsonData.getString("description"));
			account.setProfileImageUri(jsonData.getString("profile_image_url"));
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return account;
	}
}
